${play.modules.scaffold.utils.Tags.openTemplateTag}extends 'main.html' /}

<h2>${entity.controllerName}</h2>

<table class="entity ${entity.name}">
	<thead>
		<tr>
			<th><!-- actions --></th>
			#{list items:entity.formElements, as:'elem'}
	        #{ifnot elem.isPassword()}
				<th>${elem.label}</th>
	        #{/ifnot}
			#{/list}
		</tr>
	</thead>
	<tbody>
	${play.modules.scaffold.utils.Tags.openTemplateTag}list items:entities, as:'entity'}
		<tr>
			<td>
				<a href="${play.modules.scaffold.utils.Tags.openActionTag}${entity.controllerName}.show(entity.${entity.idField})}">Show</a>&nbsp;
				<a href="${play.modules.scaffold.utils.Tags.openActionTag}${entity.controllerName}.edit(entity.${entity.idField})}">Edit</a>&nbsp;
				<a href="${play.modules.scaffold.utils.Tags.openActionTag}${entity.controllerName}.delete(entity.${entity.idField})}" onclick="if (!confirm('Are you sure you want to delete this record?')) return false;">Delete</a>
			</td>
			#{list items:entity.formElements, as:'elem'}
        #{ifnot elem.isPassword()}
					<td>#{scaffold.expression entity:elem.name, expr:'entity.$1' /}</td>
        #{/ifnot}
			#{/list}
		</tr>
	${play.modules.scaffold.utils.Tags.openTemplateTag}/list}
	</tbody>
</table>

<a href="${play.modules.scaffold.utils.Tags.openActionTag}${entity.controllerName}.create}">Create</a>